#ifndef _AMANITA_TK_PANEL_H
#define _AMANITA_TK_PANEL_H

/**
 * @file amanita/tk/Panel.h  
 * @author Per Löwgren
 * @date Modified: 2012-10-21
 * @date Created: 2012-03-13
 */ 


#include <amanita/tk/Widget.h>

/** Amanita Namespace */
namespace a {
/** Amanita Tool Kit Namespace */
namespace tk {


enum {
	PANEL_CLICKED				= 0x00000001,
};

enum {
	PANEL_BUTTON = 1,
	PANEL_CHECK,
	PANEL_SEPARATOR,
};

enum {
	PANEL_DISABLED				= 0x00000001,
	PANEL_PRESSED				= 0x00000002,
	PANEL_CHECKED				= 0x00000004,
	PANEL_HIDDEN				= 0x00000008,
};


/** @cond */
class Panel;
/** @endcond */


/** Panel button.
 * @ingroup tk */
struct PanelButton {
	int style;
#ifdef USE_GTK
	const char *icon;
#endif
#ifdef USE_WIN32
	int icon;
#endif
	int action;
	int state;
	const char *label;
	const char *tooltip;
	void *data;
	Panel *panel;
};


/** Panel widget.
 * 
 * @ingroup tk */
class Panel : public Widget {
friend class Container;
friend class Window;
/** @cond */
Object_Instance(Panel)
/** @endcond */

private:
	PanelButton *buttons;
	uint32_t image_id;

	void deleteButtons();

public:	
	Panel(widget_event_handler weh,PanelButton *b);
	virtual ~Panel();

	void setButtons(PanelButton *b);

	virtual void create(Window *wnd,uint32_t st);
#ifdef USE_WIN32
	virtual void move();
#endif
};


#ifdef USE_GTK
#define PANEL_ABOUT					GTK_STOCK_ABOUT
#define PANEL_ADD						GTK_STOCK_ADD
#define PANEL_ALIGN_LEFT			GTK_STOCK_JUSTIFY_LEFT
#define PANEL_ALIGN_RIGHT			GTK_STOCK_JUSTIFY_RIGHT
#define PANEL_ALIGN_CENTER			GTK_STOCK_JUSTIFY_CENTER
#define PANEL_ALIGN_JUSTIFY		GTK_STOCK_JUSTIFY_FILL
#define PANEL_APPLY					GTK_STOCK_APPLY
#define PANEL_CANCEL					GTK_STOCK_CANCEL
#define PANEL_CDROM					GTK_STOCK_CDROM
#define PANEL_CLEAR					GTK_STOCK_CLEAR
#define PANEL_CLOSE					GTK_STOCK_CLOSE
#define PANEL_COLOR_PICKER			GTK_STOCK_COLOR_PICKER
#define PANEL_CONNECT				GTK_STOCK_CONNECT
#define PANEL_CONVERT				GTK_STOCK_CONVERT
#define PANEL_COPY					GTK_STOCK_COPY
#define PANEL_CUT						GTK_STOCK_CUT
#define PANEL_DELETE					GTK_STOCK_DELETE
#define PANEL_DIRECTORY				GTK_STOCK_DIRECTORY
#define PANEL_DISCONNECT			GTK_STOCK_DISCONNECT
#define PANEL_EDIT					GTK_STOCK_EDIT
#define PANEL_EXECUTE				GTK_STOCK_EXECUTE
#define PANEL_FILE					GTK_STOCK_FILE
#define PANEL_FIND					GTK_STOCK_FIND
#define PANEL_FIND_AND_REPLACE	GTK_STOCK_FIND_AND_REPLACE
#define PANEL_FULLSCREEN			GTK_STOCK_FULLSCREEN
#define PANEL_LEAVE_FULLSCREEN	GTK_STOCK_LEAVE_FULLSCREEN
#define PANEL_GOTO_FIRST			GTK_STOCK_GOTO_FIRST
#define PANEL_GOTO_TOP				GTK_STOCK_GOTO_TOP
#define PANEL_GOTO_LAST				GTK_STOCK_GOTO_LAST
#define PANEL_GOTO_BOTTOM			GTK_STOCK_GOTO_BOTTOM
#define PANEL_GO_BACK				GTK_STOCK_GO_BACK
#define PANEL_GO_UP					GTK_STOCK_GO_UP
#define PANEL_GO_FORWARD			GTK_STOCK_GO_FORWARD
#define PANEL_GO_DOWN				GTK_STOCK_GO_DOWN
#define PANEL_HARDDISK				GTK_STOCK_HARDDISK
#define PANEL_HELP					GTK_STOCK_HELP
#define PANEL_HOME					GTK_STOCK_HOME
#define PANEL_INDEX					GTK_STOCK_INDEX
#define PANEL_INFO					GTK_STOCK_INFO
#define PANEL_JUMP_TO				GTK_STOCK_JUMP_TO
#define PANEL_MEDIA_PREVIOUS		GTK_STOCK_MEDIA_PREVIOUS
#define PANEL_MEDIA_REWIND			GTK_STOCK_MEDIA_REWIND
#define PANEL_MEDIA_FORWARD		GTK_STOCK_MEDIA_FORWARD
#define PANEL_MEDIA_NEXT			GTK_STOCK_MEDIA_NEXT
#define PANEL_MEDIA_PLAY			GTK_STOCK_MEDIA_PLAY
#define PANEL_MEDIA_PAUSE			GTK_STOCK_MEDIA_PAUSE
#define PANEL_MEDIA_STOP			GTK_STOCK_MEDIA_STOP
#define PANEL_MEDIA_RECORD			GTK_STOCK_MEDIA_RECORD
#define PANEL_MISSING_IMAGE		GTK_STOCK_MISSING_IMAGE
#define PANEL_NETWORK				GTK_STOCK_NETWORK
#define PANEL_NEW						GTK_STOCK_NEW
#define PANEL_NO						GTK_STOCK_NO
#define PANEL_OK						GTK_STOCK_OK
#define PANEL_OPEN					GTK_STOCK_OPEN
#define PANEL_PAGE_SETUP			GTK_STOCK_PAGE_SETUP
#define PANEL_PASTE					GTK_STOCK_PASTE
#define PANEL_PREFERENCES			GTK_STOCK_PREFERENCES
#define PANEL_PRINT					GTK_STOCK_PRINT
#define PANEL_PRINT_ERROR			GTK_STOCK_PRINT_ERROR
#define PANEL_PRINT_PAUSED			GTK_STOCK_PRINT_PAUSED
#define PANEL_PRINT_PREVIEW		GTK_STOCK_PRINT_PREVIEW
#define PANEL_PRINT_REPORT			GTK_STOCK_PRINT_REPORT
#define PANEL_PRINT_WARNING		GTK_STOCK_PRINT_WARNING
#define PANEL_PROPERTIES			GTK_STOCK_PROPERTIES
#define PANEL_QUIT					GTK_STOCK_QUIT
#define PANEL_REDO					GTK_STOCK_REDO
#define PANEL_REFRESH				GTK_STOCK_REFRESH
#define PANEL_REMOVE					GTK_STOCK_REMOVE
#define PANEL_REVERT_TO_SAVED		GTK_STOCK_REVERT_TO_SAVED
#define PANEL_SAVE					GTK_STOCK_SAVE
#define PANEL_SAVE_AS				GTK_STOCK_SAVE_AS
#define PANEL_SELECT_COLOR			GTK_STOCK_SELECT_COLOR
#define PANEL_SELECT_FONT			GTK_STOCK_SELECT_FONT
#define PANEL_SORT_ASCENDING		GTK_STOCK_SORT_ASCENDING
#define PANEL_SORT_DESCENDING		GTK_STOCK_SORT_DESCENDING
#define PANEL_SPELL_CHECK			GTK_STOCK_SPELL_CHECK
#define PANEL_STOP					GTK_STOCK_STOP
#define PANEL_BOLD					GTK_STOCK_BOLD
#define PANEL_ITALIC					GTK_STOCK_ITALIC
#define PANEL_UNDERLINE				GTK_STOCK_UNDERLINE
#define PANEL_STRIKE					GTK_STOCK_STRIKETHROUGH
#define PANEL_INDENT					GTK_STOCK_INDENT
#define PANEL_UNINDENT				GTK_STOCK_UNINDENT
#define PANEL_UNDELETE				GTK_STOCK_UNDELETE
#define PANEL_UNDO					GTK_STOCK_UNDO
#define PANEL_YES						GTK_STOCK_YES
#define PANEL_ZOOM_IN				GTK_STOCK_ZOOM_IN
#define PANEL_ZOOM_OUT				GTK_STOCK_ZOOM_OUT
#define PANEL_ZOOM_100				GTK_STOCK_ZOOM_100
#define PANEL_ZOOM_FIT				GTK_STOCK_ZOOM_FIT
#endif
#ifdef USE_WIN32
enum {
	PANEL_ABOUT,
	PANEL_ADD,
	PANEL_ALIGN_LEFT,
	PANEL_ALIGN_RIGHT,
	PANEL_ALIGN_CENTER,
	PANEL_ALIGN_JUSTIFY,
	PANEL_APPLY,
	PANEL_CANCEL,
	PANEL_CDROM,
	PANEL_CLEAR,
	PANEL_CLOSE,
	PANEL_COLOR_PICKER,
	PANEL_CONNECT,
	PANEL_CONVERT,
	PANEL_COPY,
	PANEL_CUT,
	PANEL_DELETE,
	PANEL_DIRECTORY,
	PANEL_DISCONNECT,
	PANEL_EDIT,
	PANEL_EXECUTE,
	PANEL_FILE,
	PANEL_FIND,
	PANEL_FIND_AND_REPLACE,
	PANEL_FULLSCREEN,
	PANEL_LEAVE_FULLSCREEN,
	PANEL_GOTO_FIRST,
	PANEL_GOTO_TOP,
	PANEL_GOTO_LAST,
	PANEL_GOTO_BOTTOM,
	PANEL_GO_BACK,
	PANEL_GO_UP,
	PANEL_GO_FORWARD,
	PANEL_GO_DOWN,
	PANEL_HARDDISK,
	PANEL_HELP,
	PANEL_HOME,
	PANEL_INDEX,
	PANEL_INFO,
	PANEL_JUMP_TO,
	PANEL_MEDIA_PREVIOUS,
	PANEL_MEDIA_REWIND,
	PANEL_MEDIA_FORWARD,
	PANEL_MEDIA_NEXT,
	PANEL_MEDIA_PLAY,
	PANEL_MEDIA_PAUSE,
	PANEL_MEDIA_STOP,
	PANEL_MEDIA_RECORD,
	PANEL_MISSING_IMAGE,
	PANEL_NETWORK,
	PANEL_NEW,
	PANEL_NO,
	PANEL_OK,
	PANEL_OPEN,
	PANEL_PAGE_SETUP,
	PANEL_PASTE,
	PANEL_PREFERENCES,
	PANEL_PRINT,
	PANEL_PRINT_ERROR,
	PANEL_PRINT_PAUSED,
	PANEL_PRINT_PREVIEW,
	PANEL_PRINT_REPORT,
	PANEL_PRINT_WARNING,
	PANEL_PROPERTIES,
	PANEL_QUIT,
	PANEL_REDO,
	PANEL_REFRESH,
	PANEL_REMOVE,
	PANEL_REVERT_TO_SAVED,
	PANEL_SAVE,
	PANEL_SAVE_AS,
	PANEL_SELECT_COLOR,
	PANEL_SELECT_FONT,
	PANEL_SORT_ASCENDING,
	PANEL_SORT_DESCENDING,
	PANEL_SPELL_CHECK,
	PANEL_STOP,
	PANEL_BOLD,
	PANEL_ITALIC,
	PANEL_UNDERLINE,
	PANEL_STRIKE,
	PANEL_INDENT,
	PANEL_UNINDENT,
	PANEL_UNDELETE,
	PANEL_UNDO,
	PANEL_YES,
	PANEL_ZOOM_IN,
	PANEL_ZOOM_OUT,
	PANEL_ZOOM_100,
	PANEL_ZOOM_FIT,
	PANEL_ICONS,
};
#endif

}; /* namespace tk */
}; /* namespace a */


#endif /* _AMANITA_TK_PANEL_H */

